import Vue from 'vue'
import App from './App.vue'
import './components' //公共组件引入
import router from './router'
import animated from 'animate.css' // npm install animate.css --save安装，再引入
import './assets/scss/style.scss' // 导入公共样式
import VueLazyload from 'vue-lazyload'
Vue.use(animated)
Vue.config.productionTip = false
import Vconsole from 'vconsole';
if(process.env.NODE_ENV == 'development') { // 打包后隐藏 
    const vConsole =  new Vconsole();
    Vue.use(vConsole);
}


Vue.use(VueLazyload, {
    loading: require('@/assets/img/loadingImg.png'), //加载中图片，一定要有，不然会一直重复加载占位图
    // error: require('img/error.png') //加载失败图片
});

router.beforeEach((to, from, next) => {
    /* 路由发生变化修改页面title */
    if (to.meta.title) {
        document.title = to.meta.title;
    }
    next();
})
// console.log = function(){};     //将控制台打印的方法置为空
new Vue({
    el: '#app',
    router,
    render: h => h(App),
}).$mount('#app')
